home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / pmake / lst / lstClose.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-19  |  1.5 KB  |  52 lines

  1. /*-
  2.  * LstClose.c --
  3.  *    Close a list for sequential access.
  4.  *    The sequential functions access the list in a slightly different way.
  5.  *    CurPtr points to their idea of the current node in the list and they
  6.  *    access the list based on it. Because the list is circular, Lst_Next
  7.  *    and Lst_Prev will go around the list forever. Lst_IsAtEnd must be
  8.  *    used to determine when to stop.
  9.  *
  10.  * Copyright (c) 1988 by University of California Regents
  11.  *
  12.  * Permission to use, copy, modify, and distribute this
  13.  * software and its documentation for any purpose and without
  14.  * fee is hereby granted, provided that the above copyright
  15.  * notice appears in all copies.  Neither the University of California nor
  16.  * Adam de Boor makes any representations about the suitability of this
  17.  * software for any purpose.  It is provided "as is" without
  18.  * express or implied warranty.
  19.  */
  20. #ifndef lint
  21. static char *rcsid =
  22. "$Id: lstClose.c,v 1.6 88/11/17 20:51:55 adam Exp $ SPRITE (Berkeley)";
  23. #endif lint
  24.  
  25. #include    "lstInt.h"
  26.  
  27. /*-
  28.  *-----------------------------------------------------------------------
  29.  * Lst_Close --
  30.  *    Close a list which was opened for sequential access.
  31.  *
  32.  * Results:
  33.  *    None.
  34.  *
  35.  * Side Effects:
  36.  *    The list is closed.
  37.  *
  38.  *-----------------------------------------------------------------------
  39.  */
  40. void
  41. Lst_Close (l)
  42.     Lst        l;          /* The list to close */
  43. {
  44.     register List     list = (List) l;
  45.     
  46.     if (LstValid(l) == TRUE) {
  47.     list->isOpen = FALSE;
  48.     list->atEnd = Unknown;
  49.     }
  50. }
  51.  
  52.